<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
	body {
		font-size: 9pt;
	}
	table {
		font-size: 9pt;
	}
	th {
		font-weight: 500; 
		font-size: 9pt;
	}
	a:link {
		color: #dd006f; 
		text-decoration: none;
	}
	a:visited {
		text-decoration: none;
	}
	a:active {
		text-decoration: none;
	}
	a:hover {
		color: #9933ff;
		text-decoration: underline;
	}
</style>
 
<script src="${pageContext.request.contextPath}/js/JS_CheckForm.js" language="JavaScript"></script>
<script language="JavaScript">

function CheckForm(form){
	if(form.txtname.value==""){
		alert("错误提示：\n\n请你填写管理员账号　　");
		return false;
	}

	
	if(form.txtpass1.value.length<4){
		alert("错误提示：\n\n请你填写初始密码,不得少于4位!　　");
		return false;
	}
	
	if(form.txtpass1.value!=form.txtpass2.value){
		alert("错误提示：\n\n两次输入密码不同，请重输!　　");
		return false;
	}
	
	flag=true;
	for (i=0;i<form.chkLimit.length;i++){
		if(form.chkLimit[i].checked){
			flag=false;
			break;
		}
	}
	
	if(flag){
		alert("错误提示：\n\n请你给新管理员分配权限！　　");
		return false;
	}
}

function init(){

	//初始化权限选择框
	var strLimit="";
	for (i=0;i<vbform.chkLimit.length;i++){
		if(strLimit.indexOf(vbform.chkLimit[i].value)>=0){
			vbform.chkLimit[i].checked=true;
		}
	}
}
</script>

<title>网站管理员</title>
</head>
<body bgcolor="#ffffff" onload="init()" leftmargin="0" topmargin="0">
	<form onsubmit="return CheckForm(this)" id="newform" target="BackFrame" name="vbform" method="post" action="save.asp?id=">
  		<table height="100%" width="100%" cellspacing="1" cellpadding="2" border="0" bgcolor="#336600">
    		<tbody>
    			<tr> 
      				<td height="26" bgcolor="#669900" colspan="2">
      					<font color="#ffffff">::网站管理员</font>
      				</td>
    			</tr>
    			<tr bgcolor="#eeeeee"> 
      				<td height="26" width="19%" align="right">账　号：</td>
      				<td height="26" width="81%"> 
      					<input type="text" maxlength="100" size="20" value="" id="txtname" class="bginput" name="txtname">
        				<font color="#ff0000">[必填]</font>
        			</td>
    			</tr>
    			<tr bgcolor="#f9f9f9"> 
      				<td height="26" align="right">密　码：</td>
      				<td height="26">
						<input type="password" maxlength="50" size="20" value="" id="txtpass1" class="bginput" name="txtpass1">
        				<font color="#ff0000">[必填]</font>
					</td>
    			</tr>
    			<tr bgcolor="#eeeeee"> 
      				<td height="26" align="right">确认密码：</td>
      				<td height="26" bgcolor="#eeeeee">
						<input type="password" maxlength="50" size="20" value="" id="txtpass2" class="bginput" name="txtpass2"> 
      				</td>
    			</tr>
    			<tr bgcolor="#f9f9f9"> 
      				<td height="26" align="right">真实姓名：</td>
      				<td height="26"> <input type="text" maxlength="10" size="20" value="" id="txtrealname" class="bginput" name="txtrealname"></td>
    			</tr>
    			<tr valign="top" bgcolor="#eeeeee"> 
      				<td align="center" colspan="2"><table width="98%" cellspacing="0" cellpadding="0" border="0">
          				<tbody>
          					<tr>
            					<td height="154" bgcolor="#eeeeee" align="center" colspan="2"> 
              						<fieldset>
              							<legend><strong>管理权限分配</strong></legend>
              							<table width="95%" cellspacing="0" cellpadding="5" border="0">
                							<tbody>
                								<tr> 
                  									<td height="69" align="center">
														<table width="100%" cellspacing="0" cellpadding="5" border="0">
                      										<tbody>
                      											<tr> 
                        											<td>
                        												<input type="checkbox" checked="" value="管理员管理" name="chkLimit">管理员管理　
　																		<input type="checkbox" value="数据库管理" name="chkLimit">数据库管理
																	</td>
                      											</tr>
                      											<tr>
                        											<td>
						  												<input type="checkbox" value="经营产品" id="chkLimit" name="chkLimit">经营产品　
						  												<input type="checkbox" value="业务范围" id="chkLimit" name="chkLimit">业务范围　
						  												<input type="checkbox" value="新闻动态" id="chkLimit" name="chkLimit">新闻动态　
						  												<input type="checkbox" value="诚聘英才" id="chkLimit" name="chkLimit">诚聘英才　
						  												<input type="checkbox" value="给我留言" id="chkLimit" name="chkLimit">给我留言　
																	</td>
                      											</tr>
                      											<tr>
                        											<td></td>
                      											</tr>
                    										</tbody>
                    									</table>
                  									</td>
                								</tr>
                								<tr> 
                  									<td>&nbsp;</td>
                								</tr>
              								</tbody>
              							</table>
              						</fieldset>
              					</td>
            					<td>&nbsp;</td>
          					</tr>
        				</tbody>
        			</table>
        		</td>
    		</tr>
    		<tr bgcolor="#eeeeee" align="center"> 
      			<td height="40" colspan="2">
      				<table width="100%" cellspacing="0" cellpadding="5" border="0">
          				<tbody>
          					<tr> 
            					<td height="50" align="center"> 
              						<input type="submit" value="　保　存　" class="button" name="submit">
              						<input type="button" onclick="window.close()" value="　关　闭　" class="button" name="YL">
              					</td>
          					</tr>
        				</tbody>
        			</table>
        		</td>
    		</tr>
  		</tbody>
  	</table>
</form>
<iframe height="0" width="0" src="about:blank" name="BackFrame"></iframe>
<div id="livemargins_control" style="position: absolute; display: none; z-index: 9999;">
	<img height="5" width="77" style="position: absolute; left: -77px; top: -5px;" src="chrome://livemargins/skin/monitor-background-horizontal.png">
	<img style="position: absolute; left: 0pt; top: -5px;" src="chrome://livemargins/skin/monitor-background-vertical.png">
	<img style="position: absolute; left: 1px; top: 0pt; opacity: 0.5; cursor: pointer;" onmouseout="this.style.opacity=0.5" onmouseover="this.style.opacity=1" src="chrome://livemargins/skin/monitor-play-button.png" id="monitor-play-button">
</div>
</body>
</html>